package com.tianji.promotion.lock;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

@Slf4j
@Aspect
@Component
public class MyLockAspect {
    @Around("@annotation(lock)")
    public Object lock(ProceedingJoinPoint pjp,MyLock lock) throws Throwable{
        log.info(lock.name());
        return pjp.proceed();
    }
}
